gtk: Add a way to do event capture
authorCarlos Garcia Campos <cgarcia@igalia.com>
Tue, 8 Feb 2011 13:49:31 +0000 (14:49 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 1 Mar 2012 21:25:21 +0000 (16:25 -0500)
commit9f4bfff1b030fffa0d815557ec690d208cb4cd67
treedcab443bc3a3a73a1cc0c57bbdbac870df310ab7
parent6c257040a54eb91cc9323c8441b6025667dace69
gtk: Add a way to do event capture

This patch adds a capture phase to GTK+'s event propagation
model. Events are first propagated from the toplevel (or the
grab widget, if a grab is in place) down to the target widget
 and then back up. The second phase is using the existing
::event signal, the new capture phase is using a private
API instead of a public signal for now.

This mechanism can be used in many places where we currently
have to prevent child widgets from getting events by putting
an input-only window over them. It will also be used to implement
kinetic scrolling in subsequent patches.

http://bugzilla.gnome.org/show_bug.cgi?id=641836

We automatically request more motion events in behalf of
the original widget if it listens to motion hints. So
the capturing widget doesn't need to handle such
implementation details.

We are not making event capture part of the public API for 3.4,
which is why there is no ::captured-event signal.
gtk/gtkmain.c
gtk/gtkprivate.h
gtk/gtkwidget.c
gtk/gtkwidget.h
gtk/gtkwidgetprivate.h